@primary: #1EB7D8;
@secondary: #D4E9FC;
@accent: #F0F9FF;
@dark: #169DBD;
@error: #FF6B6B;

// 动画定义
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}

// 工具类
.float {
  animation: float 6s ease-in-out infinite;
}

.bounce {
  animation: bounce 2s infinite;
}

.pulse {
  animation: pulse 3s infinite;
}

.parent-register {
  min-height: 100vh;
  font-family: "Comic Sans MS", "Marker Felt", "Arial Rounded MT Bold", sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
  background-color: @accent;
  background-image:
    radial-gradient(@primary 0.3px, transparent 0.3px),
    radial-gradient(@primary 0.3px, @accent 0.3px);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  background-attachment: fixed;

  // 装饰气泡
  .decoration-bubble {
    position: absolute;
    background-color: @secondary;
    border-radius: 50%;
    opacity: 0.5;
    .float;

    &.bubble-1 {
      top: 2.5rem;
      left: 1.25rem;
      width: 4rem;
      height: 4rem;
      animation-delay: 0s;
    }

    &.bubble-2 {
      bottom: 5rem;
      right: 2rem;
      width: 3rem;
      height: 3rem;
      animation-delay: 1s;
    }

    &.bubble-3 {
      top: 33.33%;
      right: 2.5rem;
      width: 2.5rem;
      height: 2.5rem;
      animation-delay: 0.5s;
    }

    @media (max-width: 768px) {
      display: none;
    }
  }

  .register-container {
    width: 100%;
    max-width: 28rem;
    position: relative;
    z-index: 10;
  }

  // 品牌区域
  .brand-section {
    text-align: center;
    margin-bottom: 2rem;

    .logo {
      width: 4rem;
      height: 4rem;
      background-color: white;
      border-radius: 50%;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 0.75rem;
      .float;

      .logo-icon {
        font-size: 1.5rem;
        color: @primary;
      }
    }

    .brand-title {
      font-size: clamp(1.5rem, 5vw, 2rem);
      font-weight: bold;
      color: @primary;
      margin-bottom: 0.5rem;
    }

    .brand-subtitle {
      color: #6B7280;
      font-size: 0.875rem;
    }
  }

  // 表单容器
  .form-container {
    backdrop-filter: blur(4px);
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);

    .form-notice {
      color: #6B7280;
      font-size: 0.75rem;
      margin-bottom: 1.5rem;
      display: flex;
      align-items: center;
    }
  }

  // 表单字段
  .form-field {
    margin-bottom: 1rem;

    &.hidden {
      display: none;
    }

    .field-label {
      display: block;
      color: #374151;
      margin-bottom: 0.5rem;
      font-weight: 500;
      font-size: 0.875rem;
    }

    .input-wrapper {
      position: relative;

      .input-icon {
        font-size: large;
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: @primary;
        z-index: 2;
      }

      .select-arrow {
        position: absolute;
        right: 0.75rem;
        top: 50%;
        transform: translateY(-50%);
        color: #9CA3AF;
        pointer-events: none;
      }
    }

    // 手机号验证码组合布局 - 修复对齐问题
    &.phone-verify-field {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 0.75rem;
      align-items: start; // 改为顶部对齐

      .phone-field {
        .field-label {
          margin-bottom: 0.5rem;
        }
      }

      .verify-btn-wrapper {
        display: flex;
        flex-direction: column;
        justify-content: flex-start; // 改为顶部对齐
        margin-bottom: 0; // 移除底部边距
        padding-top: 1.625rem; // 对齐输入框顶部
      }
    }
  }

  // 输入框样式
  .register-input {
    width: 100%;
    padding-left: 40px;
    padding-right: 40px;
    height: 42px;
    border-radius: 16px;
    border: 1px solid #d9d9d9;
    background-color: rgba(255, 255, 255, 0.85);
    transition: all 0.3s ease;
    font-size: 16px;

    &:focus {
      border-color: @primary;
      box-shadow: 0 0 0 4px rgba(30, 183, 216, 0.15);
      outline: none;
      background-color: white;
    }

    &.error {
      border-color: @error;
      animation: shake 0.5s ease-in-out;
    }
  }

  // 错误提示
  .error-text {
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    color: @error;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    margin-top: 0;

    &.show {
      opacity: 1;
      height: auto;
      margin-top: 0.25rem;
    }

    i {
      margin-right: 0.25rem;
    }
  }

  // 验证码按钮
  .verify-btn {
    width: 100%;
    background-color: rgba(@primary, 0.1);
    color: @primary;
    height: 42px;
    font-weight: bold;
    padding: 0.625rem 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(@primary, 0.3);
    font-size: 0.875rem;
    transition: all 0.3s ease;
    white-space: nowrap;

    &:hover:not(.disabled) {
      background-color: rgba(@primary, 0.2);
    }

    &.disabled {
      background-color: #F3F4F6;
      color: #9CA3AF;
      border-color: #E5E7EB;
      cursor: not-allowed;
    }
  }

  // 单选按钮组
  .radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;

    .radio-option {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-size: 0.875rem;
      color: #374151;
      cursor: pointer;

      input[type="radio"] {
        width: 1rem;
        height: 1rem;
        color: @primary;
      }
    }
  }

  // 上传区域
  .upload-box {
    border: 2px dashed @primary;
    transition: all 0.3s ease;
    width: 100%;
    height: 8rem;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;

    &:hover {
      background-color: rgba(@primary, 0.05);
    }

    &.active {
      border-color: @dark;
      background-color: rgba(@primary, 0.1);
    }

    .file-input {
      display: none;
    }

    .upload-icon {
      color: @primary;
      font-size: 1.25rem;
      margin-bottom: 0.5rem;
    }

    .upload-text {
      color: #6B7280;
      font-size: 0.75rem;
      text-align: center;
      padding-left: 1rem;
      padding-right: 1rem;
    }
  }

  // 截图预览
  .screenshot-preview {
    margin-top: 0.5rem;

    img {
      width: 100%;
      height: 10rem;
      object-fit: cover;
      border-radius: 0.75rem;
      border: 1px solid #E5E7EB;
    }
  }

  // 提交按钮
  .submit-btn {
    width: 100%;
    background-color: @primary;
    color: white;
    padding: 1rem 0.75rem;
    border-radius: 0.75rem;
    transition: background-color 0.3s ease;
    margin-bottom: 1rem;
    .pulse;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    outline: none;
    font-size: 1rem;
    font-weight: 500;

    &:hover:not(:disabled) {
      background-color: @dark;
    }

    &:focus {
      box-shadow: 0 0 0 2px fade(@primary, 20%);
    }

    &:disabled {
      opacity: 0.7;
      cursor: not-allowed;
    }

    i {
      margin-left: 0.5rem;
    }
  }

  // 返回登录
  .back-login {
    text-align: center;
    color: @primary;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;

    i {
      margin-right: 0.25rem;
    }
  }

  // 底部提示
  .footer-notice {
    margin-top: 1.5rem;
    text-align: center;

    p {
      color: #6B7280;
      font-size: 0.75rem;

      i {
        color: @primary;
        margin-right: 0.25rem;
      }
    }
  }

  // 必填字段标记
  .required-mark {
    color: @error;
    margin-right: 0.25rem;
  }

  // 提示弹窗
  .toast {
    position: fixed;
    top: 1.25rem;
    left: 50%;
    transform: translate(-50%, -100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 100;
    background-color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 0.75rem;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 80%;

    &.show {
      transform: translate(-50%, 0);
      opacity: 1;
    }

    .toast-icon {
      width: 2rem;
      height: 2rem;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;

      &.success {
        background-color: #DCFCE7;
        color: #16A34A;
      }

      &.error {
        background-color: #FEE2E2;
        color: #DC2626;
      }
    }

    .toast-message {
      color: #374151;
      font-size: 0.875rem;
      margin: 0;
    }
  }

  // 下拉菜单样式
  .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin-top: 4px;
  }
  
}